PDF calculation